]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Don't create notification policy on demand
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 23 Mar 2020 19:59:31 +0000 (20:59 +0100)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 26 Mar 2020 18:52:10 +0000 (18:52 +0000)
This was changed in commit 8f15193b4 as a work-around for an ES6
class limitation, but now that Sources are GObject subclasses, we
no longer need to use that somewhat surprising pattern.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1131

js/ui/components/telepathyClient.js
js/ui/messageTray.js
js/ui/notificationDaemon.js
js/ui/windowAttentionHandler.js

index 5a65e84e8ba6f28d9e50c6f50306b7d657d8a5fa..b4af4388e5c592615714af8b69075a2916ebf93d 100644 (file)
@@ -292,12 +292,12 @@ class TelepathyClient extends Tp.BaseClient {
 var ChatSource = HAVE_TP ? GObject.registerClass(
 class ChatSource extends MessageTray.Source {
     _init(account, conn, channel, contact, client) {
-        super._init(contact.get_alias());
-
         this._account = account;
         this._contact = contact;
         this._client = client;
 
+        super._init(contact.get_alias());
+
         this.isChat = true;
         this._pendingMessages = [];
 
index f949345be5827886d7bbaed11e4355f05c55819f..fffdc786dc9e55304df5bd25b8cde5a282414ce0 100644 (file)
@@ -762,12 +762,10 @@ var Source = GObject.registerClass({
 
         this.notifications = [];
 
-        this._policy = null;
+        this._policy = this._createPolicy();
     }
 
     get policy() {
-        if (!this._policy)
-            this._policy = this._createPolicy();
         return this._policy;
     }
 
index 0133affd92c9bf0c44a75d831aaf6d26f76e96f5..3331355ab94084ad7ce21c8b2423fb5a583ba824 100644 (file)
@@ -416,11 +416,11 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
 var FdoNotificationDaemonSource = GObject.registerClass(
 class FdoNotificationDaemonSource extends MessageTray.Source {
     _init(title, pid, sender, appId) {
-        super._init(title);
-
         this.pid = pid;
         this.app = this._getApp(appId);
 
+        super._init(title);
+
         this.initialTitle = title;
 
         if (this.app)
@@ -631,12 +631,12 @@ class GtkNotificationDaemonAppSource extends MessageTray.Source {
         if (!app)
             throw new InvalidAppError();
 
-        super._init(app.get_name());
-
         this._appId = appId;
         this._app = app;
         this._objectPath = objectPath;
 
+        super._init(app.get_name());
+
         this._notifications = {};
         this._notificationPending = false;
     }
index f95ce4bc768623d57121a0b6d750dab597ef2a09..346fad88d17bbb11e90549b596e67382a2c31262 100644 (file)
@@ -57,11 +57,11 @@ var WindowAttentionHandler = class {
 var WindowAttentionSource = GObject.registerClass(
 class WindowAttentionSource extends MessageTray.Source {
     _init(app, window) {
-        super._init(app.get_name());
-
         this._window = window;
         this._app = app;
 
+        super._init(app.get_name());
+
         this.signalIDs = [];
         this.signalIDs.push(this._window.connect('notify::demands-attention',
                                                  this._sync.bind(this)));